<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/



Route::prefix('admin')->middleware('auth')->group(function() {
    Route::group(['prefix'=>'index'],function () {
        Route::get('/index', 'Admin\IndexController@index');
        Route::get('/clear', 'Admin\IndexController@clear');
    });

    Route::group(['prefix'=>'home'],function () {
        Route::get('/console', 'Admin\HomeController@console');
    });

    Route::get('/loginout','Admin\LoginController@loginout');

    //权限管理
    Route::group(['prefix'=>'auth'],function () {
        //管理员信息
        Route::match(['get','post'],'/adminlist','Admin\AuthController@adminlist');
        Route::match(['get','post'],'/adminadd','Admin\AuthController@adminadd');
        Route::match(['get','post'],'/adminedit','Admin\AuthController@adminedit');
        Route::post('/adminstatus', 'Admin\AuthController@adminstatus');
        Route::match(['get','post'],'/editpass','Admin\AuthController@editpass');
        Route::post('/admindel', 'Admin\AuthController@admindel');
        Route::post('/upimagesinfo', 'Admin\AuthController@upimagesinfo');

        //用户组信息
        Route::match(['get','post'],'/authgroup','Admin\AuthController@authgroup');
        Route::match(['get','post'],'/groupadd','Admin\AuthController@groupadd');
        Route::match(['get','post'],'/groupedit','Admin\AuthController@groupedit');
        Route::match(['get','post'],'/groupaccess','Admin\AuthController@groupaccess');
        Route::post('/groupdel', 'Admin\AuthController@groupdel');

        //权限列表
        Route::match(['get','post'],'/authrule','Admin\AuthController@authrule');
        Route::match(['get','post'],'/ruleadd','Admin\AuthController@ruleadd');
        Route::match(['get','post'],'/ruleedit','Admin\AuthController@ruleedit');
        Route::post('/menustatus', 'Admin\AuthController@menustatus');
        Route::post('/ruledel', 'Admin\AuthController@ruledel');
        Route::post('/rulesort', 'Admin\AuthController@rulesort');
        Route::match(['get','post'],'/rulelist','Admin\AuthController@rulelist');
    });

    //系统设置
    Route::group(['prefix'=>'config'],function () {
        Route::get('/index', 'Admin\ConfigController@index');
        Route::post('/edit', 'Admin\ConfigController@edit');
    });

    //GatewayWorker设置
    Route::group(['prefix'=>'gatewayworker'],function () {
        Route::post('/start', 'Admin\GatewayWorkerController@start');
        Route::post('/reload', 'Admin\GatewayWorkerController@reload');
        Route::post('/stop', 'Admin\GatewayWorkerController@stop');
        Route::post('/status', 'Admin\GatewayWorkerController@status');
    });

    //上传文件
    Route::group(['prefix'=>'upfiles'],function () {
        Route::post('/upimages', 'Admin\UpfilesController@upimages');
    });

});
//登录
Route::match(['get','post'],'adminlogin','Admin\LoginController@index');
